<?php
global $ilang;
if ($error) {
    ?>
    <p class="error"><?php echo $error; ?></p>
<?php } ?>
<form action="index.php?step=3" method="post">
    <fieldset>
        <legend><?php echo $ilang['INSTALL_STEP2_USER_INFO']; ?></legend>
        <p>
            <label for="name"><?php echo $ilang['INSTALL_STEP2_USER_NAME']; ?>:</label>
            <input type="text" id="name" name="name" value="<?php echo (isset($_POST['name']) ? $_POST['name'] : ''); ?>" />
        </p>
        <p>
            <label for="emal"><?php echo $ilang['INSTALL_STEP2_USER_EMAIL']; ?>:</label>
            <input type="text" id="email" name="email" value="<?php echo (isset($_POST['email']) ? $_POST['email'] : ''); ?>" />
        </p>
        <p>
            <label for="password"><?php echo $ilang['INSTALL_STEP2_USER_PASSWORD']; ?>:</label>
            <input type="password" id="password" name="password" value="<?php echo (isset($_POST['password']) ? $_POST['password'] : ''); ?>" />
        </p>
        <p>
            <label for="password2"><?php echo $ilang['INSTALL_STEP2_USER_REPEAT_PASSWORD']; ?>:</label>
            <input type="password" id="password2" name="password2" value="<?php echo (isset($_POST['password']) ? $_POST['password2'] : ''); ?>" />
        </p>
    </fieldset>
    <fieldset>
        <legend><?php echo $ilang['INSTALL_STEP2_SITE_INFO']; ?></legend>
        <p>
            <label for="sitename"><?php echo $ilang['INSTALL_STEP2_SITE_NAME']; ?>:</label>
            <input type="text" id="sitename" name="sitename" value="<?php echo (isset($_POST['sitename']) ? $_POST['sitename'] : ''); ?>" />
        </p>
        <p>
            <label for="theme"><?php echo $ilang['INSTALL_STEP2_SITE_THEME']; ?>:</label>
            <select name="theme" id="theme">
                <?php
                $selected = (isset($_POST['theme']) ? $_POST['theme'] : '');
                foreach ($themes as $key => $theme) {
                    ?>
                    <option value="<?php echo $key; ?>" <?php echo $selected == $key ? 'selected="selected"' : ''; ?>><?php echo $theme; ?></option>
                <?php } ?>
            </select>
        </p>
        <?php if ($htaccess) { ?>
            <p>
                <label for="hideindex"><?php echo $ilang['INSTALL_STEP2_SITE_HIDE_INDEX']; ?>:</label>
                <input type="checkbox" id="hideindex" name="hideindex" value="1" <?php echo (isset($_POST['hideindex']) ? 'checked="checked"' : ''); ?>/>
                <img src="resources/information.png" id="bubble1" />
            </p>
        <?php } ?>
    </fieldset>
    <fieldset>
        <legend><?php echo $ilang['INSTALL_STEP2_SYSTEM_INFO']; ?></legend>
        <p>
            <label for="sysemail"><?php echo $ilang['INSTALL_STEP2_SYSTEM_EMAIL']; ?>:</label>
            <input type="text" id="sysemail" name="sysemail" value="<?php echo (isset($_POST['sysemail']) ? $_POST['sysemail'] : ''); ?>" />
        </p>
        <p>
            <label for="adminpath"><?php echo $ilang['INSTALL_STEP2_SYSTEM_ADMIN_URL']; ?>:</label>
            <input type="text" id="adminpath" name="adminpath" value="<?php echo (isset($_POST['adminpath']) ? $_POST['adminpath'] : $defaultAdminPath); ?>" />
            <img src="resources/information.png" id="bubble2" />
        </p>
        <p>
            <label for="language"><?php echo $ilang['INSTALL_STEP2_SYSTEM_LANGUAGE']; ?>:</label>
            <select id="language" name="language">
                <?php
                $selected = (isset($_POST['language']) ? $_POST['language'] : '');
                foreach ($languages as $language) {
                    ?>
                    <option value="<?php echo $language[0]; ?>" <?php echo $selected == $language[0] ? 'selected="selected"' : ''; ?>><?php echo $language[1]; ?></option>
                <?php } ?>
            </select>
        </p>
        <p>
            <label for="shortdate"><?php echo $ilang['INSTALL_STEP2_SYSTEM_SDATE_FORMAT']; ?>:</label>
            <input type="text" id="shortdate" name="shortdate" value="<?php echo (isset($_POST['shortdate']) ? $_POST['shortdate'] : $defaultShortDate); ?>" />
            <img src="resources/information.png" id="bubble5" />
        </p>
        <p>
            <label for="longdate"><?php echo $ilang['INSTALL_STEP2_SYSTEM_LDATE_FORMAT']; ?>:</label>
            <input type="text" id="longdate" name="longdate" value="<?php echo (isset($_POST['longdate']) ? $_POST['longdate'] : $defaultLongDate); ?>" />
            <img src="resources/information.png" id="bubble6" />
        </p>
        <p>
            <label for="time"><?php echo $ilang['INSTALL_STEP2_SYSTEM_TIME_FORMAT']; ?>:</label>
            <input type="text" id="time" name="time" value="<?php echo (isset($_POST['time']) ? $_POST['time'] : $defaultTime); ?>" />
            <img src="resources/information.png" id="bubble7" />
        </p>
        <p>
            <label for="hash"><?php echo $ilang['INSTALL_STEP2_SYSTEM_HASH']; ?>:</label>
            <input type="text" id="hash" name="hash" value="<?php echo (isset($_POST['hash']) ? $_POST['hash'] : $defaultHash); ?>" />
            <img src="resources/information.png" id="bubble8" />
        </p>
    </fieldset>
    <div>
        <span style="float: left"><a href="index.php?step=1">&lt;&lt;&nbsp;<?php echo $ilang['INSTALL_STEP2_BACK']; ?></a></span>
        <span style="float: right"><input type="submit" value="<?php echo $ilang['INSTALL_STEP2_INSTALL']; ?>" /></span>
    </div>
</form>
<div style="clear: both"></div>
